package com.lc.pianostudent.conn;

import com.lc.pianostudent.bean.AnswerResultBean;
import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;

/**
 * Created by Administrator on 2018/2/22.
 */
@HttpInlet(Conn.REVIEW)
public class PostAnswerReview extends BaseAsyPost {

    public String id;
    public PostAnswerReview(AsyCallBack asyCallBack) {
        super(asyCallBack);
    }

    @Override
    protected PostAnswerReviewInfo parser(JSONObject object) throws Exception {
        if (object.optString("code").equals("200")) {

            PostAnswerReviewInfo info = new PostAnswerReviewInfo();

            info.code = object.optString("code");
            JSONObject jsonObject = object.optJSONObject("data");
            info.id = jsonObject.optString("id");
            info.title = jsonObject.optString("title");
            info.picurl = jsonObject.optString("picurl");
            info.grand = jsonObject.optString("grand");
            info.type = jsonObject.optString("type");
            info.format = jsonObject.optString("format");
            info.optionA = jsonObject.optString("optionA");
            info.optionB = jsonObject.optString("optionB");
            info.optionC = jsonObject.optString("optionC");
            info.optionD = jsonObject.optString("optionD");
            info.optionE = jsonObject.optString("optionE");
            info.optionApic = jsonObject.optString("optionApic");
            info.optionBpic = jsonObject.optString("optionBpic");
            info.optionCpic = jsonObject.optString("optionCpic");
            info.optionDpic = jsonObject.optString("optionDpic");
            info.optionEpic = jsonObject.optString("optionEpic");
            info.answer = jsonObject.optString("answer");


            TOAST = object.optString("message");
            return info;

        } else {

            TOAST = object.optString("message");

        }

        return null;
    }

    public static class PostAnswerReviewInfo {

        public String code,id,title,picurl,grand,type,format,optionA,optionB
                ,optionC,optionD,optionE,optionApic,optionBpic,optionCpic,optionDpic,optionEpic,answer;



    }

}
